package com.hjy.sync;

import com.hjy.common.domain.request.GoodsReq;
import com.hjy.common.domain.response.GoodsRes;
import com.hjy.common.result.Goods;
import com.hjy.mapper.GoodsMapper;
import com.hjy.service.EsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class EsSync {
    @Autowired
    private GoodsMapper goodsMapper;
    @Autowired
    private EsService service;
    @Scheduled(cron = "*/10 * * * * *")
    public void timeEs(){

        List<GoodsRes> list = goodsMapper.List();

        service.fiandDel();

        service.addGoods(list);

    }
}
